<?php

defined('_JEXEC') or die('Restricted access');


class DoskaViewCategory extends JViewLegacy {
	
	protected $form = null;
	protected $item = null;
	
	public function display($tpl = null) 
	{
		
		$this->form	= $this->get('Form');//getForm
		
		$this->item = $this->get('Item');
		
		$this->addToolBar();
 		$this->setDocument();
 		
		parent::display($tpl);
	}
	
	protected function addToolBar() 
	{
	
		JFactory::getApplication()->input->set('hidemainmenu', true);
		
		$isNew = ($this->item->id == 0);
		
		if ($isNew)
		{
			$title = JText::_('COM_DOSKA_MANAGER_CATEGORY_NEW');
		}
		else
		{
			$title = JText::_('COM_DOSKA_MANAGER_CATEGORY_EDIT');
		}
		
		JToolBarHelper::title($title,'doskatitle');
		
		JToolBarHelper::apply('category.apply');
		JToolBarHelper::save('category.save');
 
		JToolBarHelper::cancel('category.cancel',$isNew ? 'JTOOLBAR_CANCEL' : 'JTOOLBAR_CLOSE');
		
	}
	
	protected function setDocument() 
	{
		$document = JFactory::getDocument();
		/*$document->setTitle(JText::_('COM_DOSKA_MANEGER_TYPE_NEW_PAGE_TITLE'));*/
		$document->addStyleSheet(JUri::root(true).'/media/com_doska/css/style.css');
	}
	
	
	
}